/**
 * 
 */
package com.dp.behav.strategy;

/**
 * This is an example of Strategy design pattern. It defines a family of
 * algorithms ,encapsulates each one , and makes them interchangeable. It lets
 * the algorithm vary independently from clients that use it.
 * 
 * @author Sunaina.Sharma
 * 
 */
public class StrategyEx {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Robot r1 = new Robot("Big Robot");
		Robot r2 = new Robot("George v.2.1");

		r1.setBehaviour(new AgressiveBehaviour());
		r2.setBehaviour(new DefensiveBehaviour());
		r1.move();
		r2.move();

		System.out.println("\r\nNew behaviours: "
				+ "\r\n\t'Big Robot' gets really scared"
				+ "\r\n\t, 'George v.2.1' becomes really mad because"
				+ "it's always attacked by other robots"
				+ "\r\n\t and R2 keeps its calm\r\n");
	}
}
